<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue</title>
    <script src="./vue.min.js"></script>
    <script src="./mixins/mixins.js"></script>
    <script src="./mixins/mixins2.js"></script>
</head>
<body>
    <div id="app">
        <div>a = {{a}}</div>
        <div>b = {{b}}</div>
        <button @click="a++">a++</button>
        <button @click="say">测试</button>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            mixins: [testMixins, testMixins2],
            data () {
                return {
                    // a: 3
                }
            },
            created () {
                console.log('test1 created: this.a = ', this.a);
            },
            methods: {
                say () {
                    console.log('test1 say: hello mixins.');
                }
            },
            computed: {
                b () {
                    return this.a + 3;
                }
            },
            watch: {
                a (v) {
                    console.log('a is changed = ', v);
                }
            }
        });
    </script>
</body>
</html>